<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<!-- jsp文件头和头部 -->
<%@ include file="../../system/admin/top.jsp"%>
</head>
<body>

    

	<form action="product/${msg}.do" name="Form" id="Form" method="post">
		<input type="hidden" name="PRODUCTID" id="PRODUCTID"
			value="${pd.product_id}" />
		<div id="zhongxin">
			<table id="table_report"
				class="table table-striped table-bordered table-hover">
				<tr>
					<td style="width:70px;text-align: right;padding-top: 13px;">部门名称:</td>
					<td><select id="GROUPID" name="GROUPID" class="form-control selectpicker"
						data-live-search="true"">
							<option selected>请选择部门</option>
						    <c:if test="${not empty pd}">
						      <option
									value="${pd.group_id}" selected>${pd.group_name}</option>
						    </c:if>
							<c:forEach items="${item}" var="item">
								<option
									value="${item.GROUPID}">${item.GROUPNAME}</option>
							</c:forEach>
					</select>
					</td>
				</tr>
				<tr>
					<td style="width:70px;text-align: right;padding-top: 13px;">商品名称:</td>
					<td><input style="width:95%;" type="text" name="PRODUCTNAME"
						id="PRODUCTNAME" value="${pd. product_name}" maxlength="500"
						placeholder="这里输商品价格" title="商品价格" /></td>
				</tr>
				<tr>
					<td style="width:70px;text-align: right;padding-top: 13px;">商品编号:</td>
					<td><input style="width:95%;" type="text" name="PRODUCTNO"
						id="PRODUCTNO" value="${pd. product_no}" maxlength="500"
						placeholder="这里输入商品编号" title="商品编号" /></td>
				</tr>
				<tr>
					<td style="width:70px;text-align: right;padding-top: 13px;">商品价格:</td>
					<td><input style="width:95%;" type="text" name="PRODUCTPRICE"
						id="PRODUCTPRICE" value="${pd.product_price}" maxlength="500"
						placeholder="这里输入商品价格" title="商品价格" /></td>
				</tr>
				<tr>
					<td style="width:70px;text-align: right;padding-top: 13px;">生产日期:</td>
					<td><input style="width:95%;" type="text" name="PDATE"
						id="PDATE" value="${pd.p_date}" maxlength="500"
						placeholder="这里输入生产日期 " title="生产日期"  readonly="readonly"/></td>
				</tr>
				<tr>
					<td style="width:70px;text-align: right;padding-top: 13px;">商品类别:</td>
					<td><input style="width:95%;" type="text" name="PRODUCTCLASS"
						id="PRODUCTCLASS" value="${pd.product_class}" maxlength="2"
						placeholder="这里输入商品类别" title="类别" /></td>
				</tr>

				<tr>
					<td style="text-align: center;" colspan="10"><a
						class="btn btn-mini btn-primary" onclick="save();">保存</a> <a
						class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
					</td>
				</tr>
			</table>
		</div>

		<div id="zhongxin2" class="center" style="display:none">
			<br />
			<br />
			<br />
			<br />
			<br />
			<img src="static/images/jiazai.gif" /><br />
			<h4 class="lighter block green">提交中...</h4>
		</div>

	</form>

	<!-- 引入 -->
	<!-- 时间框 -->
	<script type="text/javascript" src="static/js/bootstrap-datepicker.min.js"></script>
	<script type="text/javascript">
		$(top.hangge());

		$("#PDATE").datepicker({
			format : 'yyyy-mm-dd hh:ii' /*此属性是显示顺序，还有显示顺序是mm-dd-yyyy*/
		});

		 
		//保存
		function save() {
			
		
			if ($("#GROUPID").val() == "请选择部门") {
				$("#GROUPID").tips({
					side : 3,
					msg : '请请选择部门',
					bg : '#AE81FF',
					time : 2
				});
				
				return false;
			}
			if ($("#PRODUCTCLASS").length > 2) {
				$("#PRODUCTCLASS").tips({
					side : 3,
					msg : '长度不能超过2',
					bg : '#AE81FF',
					time : 2
				});
				$("#PRODUCTCLASS").focus();
				return false;
			}
			if ($("#PRODUCTNAME").val() == "") {
				$("#PRODUCTNAME").tips({
					side : 3,
					msg : '请输入商品名称',
					bg : '#AE81FF',
					time : 2
				});
				$("#PRODUCTNAME").focus();
				return false;
			}
			if ($("#PRODUCTPRICE").val() == "") {
				$("#PRODUCTPRICE").tips({
					side : 3,
					msg : '请输入商品价格',
					bg : '#AE81FF',
					time : 2
				});
				$("#PRODUCTPRICE").focus();
				return false;
			}

			$("#Form").submit();
		}
	</script>


</body>
</html>

